package star.crust.cartspace.framework;

import java.util.ArrayList;
import java.util.Iterator;

public class CrtBodyGroup {
	private String id = "";
	private ArrayList<CrtBody> bodies = null;

	public CrtBodyGroup(String id) {
		this.id = id;
		bodies = new ArrayList<CrtBody>();
	}
	public void addBody(CrtBody body) {
		bodies.add(body);
	}
	public Iterator<CrtBody> iterator() {
		return bodies.iterator();
	}
	public String toString() {
		String doc = "<CrtBodyGroup " + id + ">";
		Iterator<CrtBody> iterator = bodies.iterator();
		while(iterator.hasNext()) {
			doc += "\n    " + iterator.next().toString();
		}
		return doc;
	}	
}
